<script lang="ts" setup>
import { ref, reactive } from 'vue'
import dspTab from './tabs/sp-tab.vue'
import yspTab from './tabs/sp-tab.vue'
import { useRoute } from 'vue-router'

const loading = ref<boolean>(false)
const route = useRoute()
const activeName = ref((route.query.prePage as string) || 'dsp')

let tabsList = reactive([
  {
    label: '待审批',
    name: 'dsp',
  },
  {
    label: '已审批',
    name: 'ysp',
  },
])
</script>
<template>
  <div class="container" v-loading="loading">
    <el-tabs type="card" v-model="activeName">
      <el-tab-pane
        v-for="item in tabsList"
        :key="item.name"
        :label="item.label"
        :name="item.name"
        lazy
      >
        <dsp-tab ref="dgdRef" v-if="activeName === 'dsp'" :activeName="activeName"></dsp-tab>
        <ysp-tab ref="dgdRef" v-if="activeName === 'ysp'" :activeName="activeName"></ysp-tab>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<style lang="scss" scoped>
.container {
  width: 100%;
  height: 100%;
  background-color: #fff;
}
</style>
